<template>
  <div class="NotForSaleEdit" v-if="form">
    <div class="NotForSaleEdit-one borderbottom">
      <div class="NotForSaleEdit-title">
        <div></div>
        <div>基础信息</div>
      </div>
      <div class="NotForSaleEdit-one-content">
        <div>
          <div class="" style="margin-right: 30px">
            款号：{{ form.type_no }}
          </div>
          <div class="" style="margin-right: 30px">
            品名：{{ form.type_name }}
          </div>
        </div>
        <div>
          <div>成衣图：</div>
          <el-upload
            action="https://ssy.13yu.com/index.php/Admin/Api/upload"
            list-type="picture-card"
            ref="uploadcy"
            :file-list="form.wear_image"
            :on-remove="handleRemove"
            disabled
          >
            <i slot="default" class="el-icon-plus"></i>
          </el-upload>
        </div>
      </div>
    </div>

    <div class="NotForSaleEdit-one borderbottom">
      <div class="NotForSaleEdit-title">
        <div></div>
        <div>部位信息</div>
        <!-- <i
          class="el-icon-circle-plus-outline pointer"
          style="color: #409eff; font-size: 24px; margin-left: 10px"
        ></i> -->
      </div>
      <div class="NotForSaleEdit-one-position" v-if="false">
        <div>
          <div class="star">服装类别：</div>
          <el-select
            style="width: 400px"
            v-model="base_id"
            placeholder="请选择服装类别"
            @change="changebaseid"
          >
            <el-option
              v-for="item in Basecode"
              :key="item.id"
              :label="item.base_category"
              :value="item.id"
            ></el-option>
          </el-select>
        </div>
        <div>
          <div class="star">方案选择：</div>
          <el-select
            style="width: 400px"
            v-model="programme_id"
            placeholder="请选择方案选择"
            :disabled="!base_id"
          >
            <el-option
              v-for="item in Programme"
              :key="item.id"
              :label="item.programme_title"
              :value="item.id"
            ></el-option>
          </el-select>
        </div>
        <div style="margin-left: 20px">
          <el-button
            type="primary"
            size="default"
            :disabled="!base_id || !programme_id"
            v-if="!form.plank_house_table_data"
            @click="onSubmit"
            >确定</el-button
          >
          <el-button
            type="primary"
            size="default"
            :disabled="!base_id || !programme_id"
            v-else
            @click="onSubmitEdit"
            >编辑</el-button
          >
          <!-- <el-button type="" size="default">另存为方案</el-button> -->
        </div>
      </div>
      <div>
        <div style="color: #409eff; margin: 10px 0">
          注：修改档差、基码信息，其他尺码信息将同步更新
        </div>
        <el-table
          :data="form.plank_house_table_data"
          v-if="form.plank_house_table_data"
          border
          style="width: 100%"
          :header-cell-style="changeHeaderCellStyle"
        >
          <el-table-column
            prop="position_title"
            label="同步上新表"
            align="center"
          >
            <template slot-scope="{ row }">
              <el-checkbox
                disabled
                v-model="row.is_new"
                :true-label="1"
                :false-label="0"
              ></el-checkbox>
            </template>
          </el-table-column>
          <el-table-column prop="position_title" label="部位" align="center">
            <template slot-scope="{ row }">
              <el-input
                v-model="row.position_title"
                placeholder="请输入部位"
                size="normal"
                readonly="readonly"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="position_method"
            label="测量方法"
            align="center"
          >
            <template slot-scope="{ row }">
              <el-input
                v-model="row.position_method"
                placeholder="请输入测量方法"
                size="normal"
                readonly="readonly"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="remarks" label="备注" align="center">
            <template slot-scope="{ row }">
              <el-input
                v-model="row.remarks"
                placeholder="请输入备注"
                size="normal"
                readonly="readonly"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="gear_difference" label="*档差" align="center">
            <template slot-scope="{ row }">
              <el-input
                v-model="row.gear_difference"
                placeholder="请输入档差"
                size="normal"
                type="number"
                @input="changeGearOne(row)"
                readonly="readonly"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column
            v-for="(item, index) in form.plank_house_table_title.code_list"
            :key="index"
            :label="item.size_code.title"
            align="center"
          >
            <el-table-column
              :prop="item.size_code.title"
              :key="index"
              :label="item.height_code.title + '/' + item.waist_code.title"
              align="center"
            >
              <template slot-scope="{ row, column }">
                <el-input
                  v-model="row.code_list[item.size_code.title]"
                  placeholder="请输入"
                  size="normal"
                  type="number"
                  @input="changeGearOne(row, column)"
                  readonly="readonly"
                ></el-input>
              </template>
            </el-table-column>
          </el-table-column>
          <el-table-column
            prop="sample_code"
            :label="form.plank_house_table_title.sample_code"
            align="center"
          >
            <template slot-scope="{ row }">
              <el-input
                v-model="row.sample_code"
                placeholder="请输入样板尺寸(cm)"
                size="normal"
                type="number"
                readonly="readonly"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="tolerance" label="公差±(cm)" align="center">
            <template slot-scope="{ row }">
              <el-input
                v-model="row.tolerance"
                placeholder="请输入公差±(cm)"
                size="normal"
                type="number"
                readonly="readonly"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            label="操作"
            align="center"
            v-if="false"
          >
            <template slot-scope="{ $index }">
              <el-button
                type="text"
                size="default"
                style="color: red"
                @click="onDeleteOne($index)"
                >删除</el-button
              >
            </template>
          </el-table-column>
        </el-table>
        <!-- <div

          class="plus pointer"
          v-if="form.plank_house_table_data"
          @click="onAddObj"
        >
          +
        </div> -->
      </div>
    </div>
    <div class="NotForSaleEdit-one borderbottom">
      <div class="NotForSaleEdit-title">
        <div></div>
        <div>测量图</div>
      </div>
      <div class="NotForSaleEdit-one-content">
        <div>
          <div>上传图片：</div>
          <el-upload
            action="https://ssy.13yu.com/index.php/Admin/Api/upload"
            list-type="picture-card"
            ref="uploadcl"
            :file-list="form.measure_image"
            :on-remove="handleRemove"
            disabled
          >
            <i slot="default" class="el-icon-plus"></i>
          </el-upload>
        </div>
      </div>
    </div>
    <div class="NotForSaleEdit-one borderbottom">
      <div class="NotForSaleEdit-title">
        <div></div>
        <div>特别注意</div>
      </div>
      <div class="NotForSaleEdit-one-content">
        <el-input
          type="textarea"
          v-model="form.be_careful"
          placeholder="请输入"
          size="normal"
          clearable
          readonly="readonly"
        ></el-input>
      </div>
    </div>
    <div class="NotForSaleEdit-one borderbottom">
      <div class="NotForSaleEdit-title">
        <div></div>
        <div>温馨提示</div>
      </div>
      <div class="NotForSaleEdit-one-content">
        <el-input
          type="textarea"
          v-model="form.reminder"
          placeholder="请输入"
          size="normal"
          clearable
          readonly="readonly"
        ></el-input>
      </div>
    </div>
    <div class="NotForSaleEdit-one borderbottom">
      <div class="NotForSaleEdit-title">
        <div></div>
        <div>成衣风险</div>
      </div>
      <div class="NotForSaleEdit-one-content">
        <el-input
          type="textarea"
          :rows="3"
          v-model="form.risk"
          placeholder="请输入"
          size="normal"
          clearable
          readonly="readonly"
        ></el-input>
      </div>
    </div>
    <!-- <div>
      <el-button
        type="primary"
        size="default"
        @click="onSave"
        :loading="loading"
        >保 存</el-button
      >
    </div> -->
    <el-dialog
      title="部位信息"
      :visible.sync="dialogVisible"
      :before-close="handleClose"
      v-if="product_base_code"
    >
      <div>
        <el-table :data="plank_house_table_data" border style="width: 100%">
          <el-table-column prop="position_title" label="部位" align="center">
            <template slot-scope="{ row }">
              <el-input
                v-model="row.position_title"
                placeholder="请输入部位"
                size="normal"
                readonly="readonly"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="position_method"
            label="测量方法"
            align="center"
          >
            <template slot-scope="{ row }">
              <el-input
                v-model="row.position_method"
                placeholder="请输入测量方法"
                size="normal"
                readonly="readonly"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="remarks" label="备注" align="center">
            <template slot-scope="{ row }">
              <el-input
                v-model="row.remarks"
                placeholder="请输入备注"
                size="normal"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="gear_difference" label="*档差" align="center">
            <template slot-scope="{ row }">
              <el-input
                v-model="row.gear_difference"
                placeholder="请输入档差"
                size="normal"
                type="number"
                @input="changeGear(row)"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="address"
            :label="'*基码-' + product_base_code.base_code.size_code.title"
            align="center"
          >
            <template slot-scope="{ row }">
              <el-input
                v-model="
                  row.code_list[product_base_code.base_code.size_code.title]
                "
                placeholder="请输入基码"
                size="normal"
                type="number"
                @input="changeGear(row)"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="sample_code"
            :label="plank_house_table_title.sample_code"
            align="center"
          >
            <template slot-scope="{ row }">
              <el-input
                v-model="row.sample_code"
                placeholder="请输入样板尺寸(cm)"
                size="normal"
                type="number"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="tolerance" label="公差±(cm)" align="center">
            <template slot-scope="{ row }">
              <el-input
                v-model="row.tolerance"
                placeholder="请输入公差±(cm)"
                size="normal"
                type="number"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column prop="address" label="操作" align="center">
            <template slot-scope="{ $index }">
              <el-button
                type="text"
                size="default"
                style="color: red"
                @click="onDelete($index)"
                >删除</el-button
              >
            </template>
          </el-table-column>
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" :disabled="isSubmit" @click="onVisibleSubmit"
          >确 定</el-button
        >
      </span>
    </el-dialog>
    <el-dialog
      title="添加部位信息"
      :visible.sync="dialogVisiblePosition"
      v-if="objs"
      :before-close="handleClose"
    >
      <div class="position">
        <div>
          <div class="star">部位</div>
          <div>
            <el-select
              v-model="positionObj"
              placeholder="请选择部位"
              value-key="id"
              @change="changepositionObj"
            >
              <el-option
                v-for="item in position"
                :key="item.id"
                :label="item.position_title"
                :value="item"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div>
          <div class="star">测量方法</div>
          <div>
            <el-input
              readonly="readonly"
              v-model="objs.position_method"
              placeholder=""
              size="normal"
            ></el-input>
          </div>
        </div>
        <div>
          <div class="star">档差</div>
          <div>
            <el-input
              v-model="objs.gear_difference"
              placeholder="请输入档差"
              type="number"
              size="normal"
              @input="changeGearobjs(objs)"
            ></el-input>
          </div>
        </div>
        <div>
          <div class="star">基码尺寸</div>
          <div>
            <el-input
              v-model="objs.code_list[objs.code]"
              placeholder="请输入基码尺寸"
              type="number"
              size="normal"
              @input="changeGearobjs(objs)"
            ></el-input>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleClosePosition">取 消</el-button>
        <el-button
          type="primary"
          :disabled="
            !objs.position_title || !objs.gear_difference || !objs.code_list
          "
          @click="onVisibleSubmitObjs"
          >确 定</el-button
        >
      </span>
    </el-dialog>
    <el-collapse class="log" v-if="log_list.length">
      <el-collapse-item title="更新日志" name="1">
        <div v-for="(item, index) in log_list" :key="index">
          {{ item.createtime }}
          {{ item.content }}
        </div>
      </el-collapse-item>
    </el-collapse>
  </div>
</template>

<script>
import {
  postAdminOperateGetPosition,
  postAdminOperateLook_new_products_plank_house,
  postAdminOperateSet_new_products_plank_house,
  postAdminOperateGetSelectedBase,
  postAdminOperateGetProgramme,
  postAdminOperateGetBasecode,
} from "@/api";
export default {
  data() {
    return {
      isSubmit: true,
      Basecode: [],
      Programme: [],
      position: [],
      dialogVisiblePosition: false,
      dialogVisible: false,
      disabled: false,
      loading: false,
      base_id: "",
      programme_id: "",
      plank_house_table_title: "", //表头
      plank_house_table_data: "", //表数据
      product_base_code: "", // 基码相关参数
      is_base_title: "", // 基码
      objs: "",
      positionObj: "",
      form: "",
      log_list: "",
    };
  },
  async mounted() {
    this.postAdminOperateGetBasecode();
    this.postAdminOperateGetPosition();
    if (this.$route.query.type_no) {
      this.postAdminOperateLook_new_products_plank_house(
        this.$route.query.type_no
      );
    }
  },
  methods: {
    onSubmitEdit() {
      let that = this;
      this.$confirm(
        "即将修改部位信息，点击确定后部位信息原有表格数据会被完全清除，请谨慎操作！",
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      )
        .then(() => {
          this.onSubmit();
        })
        .catch(() => {});
    },
    changepositionObj(e) {
      this.objs.position_title = e.position_title;
      this.objs.position_method = e.position_method;
    },
    postAdminOperateGetPosition() {
      let obj = {
        size: 10000,
        page: 1,
      };
      postAdminOperateGetPosition(obj).then((res) => {
        this.position = res.data;
      });
    },
    onAddObj() {
      let { form } = this;
      let { code_list } = this.form.plank_house_table_data[0];
      let objs = {};
      for (const key in code_list) {
        objs[key] = "";
      }
      let code;
      let code_lists = form.plank_house_table_title.code_list;
      code_lists.forEach((item) => {
        if (item.is_base == 1) {
          code = item.size_code.title;
        }
      });
      let obj = {
        code,
        is_new: "",
        position_title: "",
        position_method: "",
        remarks: "",
        gear_difference: "",
        code_list: objs,
      };
      this.objs = obj;
      this.dialogVisiblePosition = true;
      // form.plank_house_table_data.push(obj);
      // this.form = form;
    },
    changeHeaderCellStyle(row, rowIndex) {
      if (row.column.label == this.is_base_title) {
        return { color: "red" };
      }
    },
    handleClose() {
      this.plank_house_table_title = "";
      this.plank_house_table_data = "";
      this.product_base_code = "";
      this.dialogVisible = false;
    },
    handleClosePosition() {
      this.objs = "";
      this.dialogVisiblePosition = false;
    },
    onDeleteOne(idx) {
      let { plank_house_table_data } = this.form;
      this.$confirm("确定删除？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        plank_house_table_data.splice(idx, 1);
        this.form.plank_house_table_data = plank_house_table_data;
      });
    },
    onDelete(idx) {
      let { plank_house_table_data } = this;
      this.$confirm("确定删除？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        plank_house_table_data.splice(idx, 1);
        this.plank_house_table_data = plank_house_table_data;
      });
    },
    changeGearobjs(e) {
      let code = e.code;
      if (e.gear_difference && e.code_list[code]) {
        let arr = [];
        let codenumber = e.code_list[code];
        let gear_difference = e.gear_difference;
        for (let key in e.code_list) {
          arr.push(key);
        }
        let index = arr.findIndex((n) => n == code);
        console.log("arr", arr);
        arr.forEach((element, idx) => {
          console.log(element, idx);
          if (element == code) return;
          e.code_list[element] =
            Number(codenumber) + Number(gear_difference) * (idx - index);
        });
      }
    },
    onVisibleSubmitObjs() {
      let { form } = this;
      form.plank_house_table_data.push(this.objs);
      this.form = form;
      this.handleClosePosition();
    },
    changeGearOne(e, column) {
      console.log("eeee---->", column);
      let { form } = this;
      let code;
      let code_list = form.plank_house_table_title.code_list;
      code_list.forEach((item) => {
        if (item.is_base == 1) {
          code = item.size_code.title;
        }
      });
      if (!column || column.property == code) {
        if (e.gear_difference && e.code_list[code]) {
          let arr = [];
          let codenumber = e.code_list[code];
          let gear_difference = e.gear_difference;
          for (let key in e.code_list) {
            arr.push(key);
          }
          let index = arr.findIndex((n) => n == code);
          console.log("arr", arr);
          arr.forEach((element, idx) => {
            console.log(element, idx);
            if (element == code) return;
            e.code_list[element] =
              Number(codenumber) + Number(gear_difference) * (idx - index);
          });
        }
      }
    },
    changeGear(e) {
      let { product_base_code, plank_house_table_data } = this;
      let code = product_base_code.base_code.size_code.title;

      if (e.gear_difference && e.code_list[code]) {
        let arr = [];
        let codenumber = e.code_list[code];
        let gear_difference = e.gear_difference;
        for (let key in e.code_list) {
          arr.push(key);
        }
        let index = arr.findIndex((n) => n == code);
        console.log("arr", arr);
        arr.forEach((element, idx) => {
          console.log(element, idx);
          if (element == code) return;
          e.code_list[element] =
            Number(codenumber) + Number(gear_difference) * (idx - index);
        });
      }
      let isTrue = plank_house_table_data.some((item) => {
        return !item.gear_difference || !item.code_list[code];
      });
      if (!isTrue) {
        this.isSubmit = false;
      } else {
        this.isSubmit = true;
      }
    },
    // 部位信息确认
    onVisibleSubmit() {
      this.is_base_title =
        this.product_base_code.base_code.height_code.title +
        "/" +
        this.product_base_code.base_code.waist_code.title;
      this.form.plank_house_table_title = JSON.parse(
        JSON.stringify(this.plank_house_table_title)
      );
      this.form.plank_house_table_data = JSON.parse(
        JSON.stringify(this.plank_house_table_data)
      );
      this.handleClose();
    },
    // 确定
    async onSubmit() {
      let { base_id, programme_id } = this;
      let obj = {
        base_id,
        programme_id,
      };
      await postAdminOperateGetSelectedBase(obj).then((res) => {
        console.log("Res===>", res);
        let { product_base_code, product_programme } = res.data;
        this.product_base_code = product_base_code;
        this.form.products_base_cdoe = product_base_code;
        this.plank_house_table_title = {
          is_new: "同步上新表",
          position_title: "部位",
          position_method: "测量方法",
          remarks: "备注",
          gear_difference: "档差",
          sample_code:
            product_base_code.base_size_code[
              product_base_code.base_size_code.length - 1
            ].size_code.title + "样板尺码(cm)",
          tolerance: "公差±(cm)",
          code_list: product_base_code.base_size_code,
        };
        console.log("product_base_code", product_base_code);

        let arr = [];
        let objs = {};
        product_base_code.base_size_code.forEach((e) => {
          objs[e.size_code.title] = "";
        });
        product_programme.position_data.forEach((element) => {
          let obj = {
            is_new: 0,
            position_title: element.position_title,
            position_method: element.position_method,
            remarks: "",
            gear_difference: "",
            code_list: JSON.parse(JSON.stringify(objs)),
          };
          arr.push(obj);
        });
        this.plank_house_table_data = arr;
      });
      this.form.base_id = base_id;
      this.form.programme_id = programme_id;
      this.dialogVisible = true;
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    async postAdminOperateLook_new_products_plank_house(type_no) {
      let obj = {
        type_no,
      };
      let res = await postAdminOperateLook_new_products_plank_house(obj);
      let data = res.data;
      data.wear_image = data.wear_image || [];
      data.measure_image = data.wear_image || [];
      let arrcy = [];
      if (data.wear_image.length) {
        data.wear_image.forEach((e) => {
          let obj = {
            url: e,
            name: e,
          };
          arrcy.push(obj);
        });
      }
      data.wear_image = arrcy;
      let arrcl = [];
      if (data.measure_image.length) {
        data.measure_image.forEach((e) => {
          let obj = {
            url: e,
            name: e,
          };
          arrcl.push(obj);
        });
      }
      data.measure_image = arrcl;
      if ("base_id" in data) {
      } else {
        data.base_id = "";
      }
      if ("programme_id" in data) {
      } else {
        data.programme_id = "";
      }
      let objdata = {
        base_id: data.base_id,
        programme_id: data.programme_id,
        type_no: data.type_no,
        package_number: data.package_number,
        wear_image: data.wear_image,
        measure_image: data.measure_image,
        be_careful: data.be_careful,
        reminder: data.reminder,
        risk:
          data.risk ||
          `1.   面料测试劈裂度需合格后方可生产大货.
2.   金属物件做抗氧化处理.
3.   面料互染色牢度测试需合格后方可生产大货.
`,
        plank_house_table_title: data.plank_house_table_title,
        plank_house_table_data: data.plank_house_table_data,
        type_name: data.type_name,
        products_base_cdoe: data.products_base_cdoe || "",
      };
      this.product_base_code = data.products_base_cdoe || "";
      if (data.products_base_cdoe) {
        this.is_base_title =
          data.products_base_cdoe.base_code.height_code.title +
          "/" +
          data.products_base_cdoe.base_code.waist_code.title;
      }
      this.log_list = data.log_list;
      this.form = objdata;
    },

    async onSave() {
      this.loading = true;
      let { form } = this;
      let uploadcy = this.$refs.uploadcy.uploadFiles;
      let uploadcl = this.$refs.uploadcl.uploadFiles;
      let wear_image = [];
      if (uploadcy && uploadcy.length) {
        uploadcy.forEach((e) => {
          if (!e.response) {
            wear_image.push(e.url);
          } else {
            wear_image.push(e.response.img);
          }
        });
      } else {
        this.loading = false;
        return this.$message.warning("请上传成衣图");
      }
      let measure_image = [];
      if (uploadcl && uploadcl.length) {
        uploadcl.forEach((e) => {
          if (!e.response) {
            measure_image.push(e.url);
          } else {
            measure_image.push(e.response.img);
          }
        });
      } else {
        this.loading = false;
        return this.$message.warning("请上传测量图");
      }
      form.wear_image = wear_image;
      form.measure_image = measure_image;

      if (form.plank_house_table_data && form.plank_house_table_data.length) {
        let isTrue = form.plank_house_table_data.some((e) => {
          this.loading = false;
          return (
            !e.position_title ||
            !e.position_method ||
            !e.gear_difference ||
            !e.sample_code ||
            !e.tolerance
          );
        });
        if (isTrue) {
          this.loading = false;
          return this.$message.warning("请输入完整的部位信息");
        }
      } else {
        this.loading = false;
        return this.$message.warning("请设置部位信息");
      }
      if (!form.be_careful) {
        this.loading = false;
        return this.$message.warning("请输入特别注意");
      }
      if (!form.reminder) {
        this.loading = false;
        return this.$message.warning("请输入温馨提示");
      }
      if (!form.risk) {
        this.loading = false;
        return this.$message.warning("请输入成衣风险");
      }
      try {
        await postAdminOperateSet_new_products_plank_house(form);
        this.$message.success("保存成功");
        setTimeout(() => {
          this.loading = false;
          this.$router.go(-1);
        }, 1000);
      } catch (error) {
        this.loading = false;
      }
    },
    handleRemove(file) {},
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    // 基码列表
    postAdminOperateGetBasecode() {
      let obj = {
        page: 1,
        size: 1000,
      };
      postAdminOperateGetBasecode(obj).then((res) => {
        this.Basecode = res.data;
      });
    },
    changebaseid(e) {
      let obj = {
        base_category_id: e,
        page: 1,
        size: 1000,
      };
      postAdminOperateGetProgramme(obj).then((res) => {
        this.Programme = res.data;
        this.programme_id = "";
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.log {
  background: #ffffff;
  left: 60px;
  padding: 0 20px;
  position: fixed;
  bottom: 0;
  width: calc(100% - 120px);
}
.position {
  > div {
    display: flex;
    align-items: center;
    margin-top: 10px;
    > div:nth-child(1) {
      width: 100px;
    }
  }
}
.plus {
  width: 100%;
  text-align: center;
  height: 60px;
  line-height: 60px;
  font-size: 30px;
  border: 1px solid #ebeef5;
  border-top: none;
}
.borderbottom {
  border-bottom: 1px solid #efefef;
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.NotForSaleEdit {
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  padding-bottom: 60px;
  .NotForSaleEdit-title {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 800;
    padding-bottom: 20px;
    > div:nth-child(1) {
      width: 4px;
      height: 26px;
      border-radius: 4px;
      background: #409eff;
      margin-right: 10px;
    }
  }
  .NotForSaleEdit-one {
    .NotForSaleEdit-one-content {
      /deep/ .el-upload-list__item-thumbnail {
        object-fit: contain;
      }
      > div {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        > div:nth-child(2) {
          display: flex;
          align-items: center;
        }
      }
    }
    .NotForSaleEdit-one-position {
      display: flex;
      align-items: center;
      > div {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        > div:nth-child(1) {
          width: 140px;
          text-align: right;
          margin-right: 10px;
        }
        > .el-input {
          width: 400px;
        }
        > div:nth-child(2) {
          display: flex;
          align-items: center;
        }
      }
    }
  }
  .NotForSaleEdit-two {
    .NotForSaleEdit-two-content {
      display: flex;
      flex-wrap: wrap;
      > div {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        > div:nth-child(1) {
          width: 140px;
          text-align: right;
          margin-right: 10px;
        }
        /deep/ .el-input {
          width: 400px;
        }
      }
    }
  }
}
</style>